import {request} from 'network/request.js'
import Qs from 'qs'

export function getEmpByAccPwd(account,pwd){
  return request({
    url: '/getEmpByAccPwd',
    method: "post",
    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
    data: Qs.stringify({
      empAccount: account,
      empPwd: pwd
    }),
  })
}

export function getEmpById(docId){
  return request({
    url: '/getEmpById',
    params: {
      id: docId
    }
  })
}

export function selEmp(payload){
  return request({
    url: '/selEmp',
    params: payload
  })
}

export function addEmp(payload){
  return request({
    url: '/addEmp',
    method: "post",
    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
    data: Qs.stringify(payload)
  })
}

export function updEmp(payload){
  return request({
    url: '/updEmp',
    method: "post",
    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
    data: Qs.stringify(payload)
  })
}
